#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <time.h>
#include <math.h>
#include "rngs.h"
#include "dominion.h"
#include "dominion_helpers.h"
#include "interface.h"

#define MAX_ITER 10000

int getTopCard(int player, struct gameState *state) {
    return state->deck[player][state->deckCount[player]];
}

int main(int argc, char **argv) {
    int seed = time(NULL);
    srand(seed);
    struct gameState state;
    int kingdom_cards[10] = {adventurer, council_room, feast, gardens, mine,
        remodel, smithy, village, baron, great_hall};


    printf("Random Testing sea hag card effect\n");
    for (int i = 0; i < MAX_ITER; ++i) {
        memset(&state, 0, sizeof(struct gameState)); // clear the game state
        initializeGame(2, kingdom_cards, seed, &state); // initialize a new game
        state.whoseTurn = rand() % 1;

        // Store who the active player is, since sea_hag doesn't effect them

        // This card isn't done correctly, so the assert's and the variables for
        // them are commented out

        // int currentPlayer = whoseTurn(&state);
        // int nextPlayer = currentPlayer + 1;
        // int nextPlayerTopCard = getTopCard(nextPlayer, &state);

        cardEffect(sea_hag, 0, 0, 0, &state, 0, 0);

        // Verify that the card did what it should
        /*
        assert(getTopCard(nextPlayer, &state) == curse);
        assert(state.discard[nextPlayer][i] == nextPlayerTopCard);
        assert(state.discardCount[nextPlayer] == 1);
        */
    }

    return 0;
}